PageSpy server will automatically read the **`config.json` configuration file in the current running directory** when it runs. This file does not exist when first run. You can create or modify this file as needed to customize server behavior.

The configuration file can configure the following: running port, multi-instance deployment, cross-domain configuration, log data configuration, database configuration, etc. The following explains the purpose of each configuration field.


```json
{
  // Server port
  "port": "6752",
  // Maximum log file size (MB)
  "maxLogFileSizeOfMB": 10240,
  // Maximum log file save time (hour)
  "maxLogLifeTimeOfHour": 720,
  // Whether to allow users to delete logs on the interface
  "notAllowedDeleteLog": false,
  // Maximum number of rooms
  "maxRoomNumber": 500,
  // Cross-domain configuration
  "corsConfig": {
    // Allowed domains
    "allowOrigins": ["*"],
    // Allowed request headers
    "allowHeaders": [
      "Origin",
      "Authorization",
      "Content-Length",
      "X-Request-Id",
      "Content-Type",
      "Referer",
      "User-Agent",
      "Host"
    ],
    // Allowed request methods
    "allowMethods": [
      "HEAD",
      "POST",
      "GET",
      "OPTIONS",
      "PUT",
      "DELETE",
      "UPDATE"
    ],
    // Exposed request headers
    "exposeHeaders": ["X-Request-Id"]
  },
  // S3-compatible storage configuration
  "storageConfig": {
    "baseDir": "",
    "keyId": "",
    "secret": "",
    "bucket": "",
    "region": "",
    "endpoint": "",
    // s3ForcePathStyle=false for virtual-hosted–style api(for default)
    // s3ForcePathStyle=true  for path-style api
    "s3ForcePathStyle": false
  },
  // Authentication configuration
  "authConfig": {
    // Authentication password
    "password": "",
    // JWT secret
    "jwtSecret": "",
    // Token expiration time (hours)
    "tokenExpiration": 720
  },
  // When deploy in mode of multiple-instances, configure it use machine IP or dns name in container
  "selfRpcAddress": {
    "ip": "", // Machine IP or dns name in container
    "port": "" // Server port
  },
  // Multi-instance deployment configuration
  "rpcAddress": [
    {
      "ip": "", // Machine IP or dns name in container
      "port": "" // Server port
    },
    {
      "ip": "",
      "port": ""
    },
    ...
  ],
  // Configure MySQL database address, default using SQLite
  "databaseConfig": {
    "mysqlUrl": "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local"
  },
}
```